#!/usr/bin/perl
use utf8;
use strict;
use Data::Dumper;

$Data::Dumper::Useqq = 1;{
 no warnings 'redefine';
 sub Data::Dumper::qquote {
   my $s = shift;
   return "'$s'";
 }
}

open (FILE, "out.txt") or die "Sorry, but i can't open 'out.txt'";
binmode(FILE, ":encoding(utf-8)");
binmode(STDOUT, ":encoding(utf-8)");
binmode(STDERR, ":encoding(utf-8)");

my @s=<FILE>;
my %persn;
my $i;

foreach my $line (@s){
	if ($i = index($line, "FPerson") != -1)
	{
		$i = index ($line, "= ");
		$a = substr ($line, $i+2,length($line)-$i-3);
		$persn{lc($a)} += 1;
		
	}
}
my @sort = sort {$persn{$b} <=> $persn{$a}} keys %persn;
my $el;
foreach $el (@sort){
	print $el, " => ", $persn{$el}, "\n";
}


#print Dumper(\%persn);

